package com.wanboedu.controller;

import com.wanboedu.dto.UserDTO;
import com.wanboedu.result.Result;
import com.wanboedu.service.UserService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/user")
@Slf4j
@Api("用户接口")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/update")
    public Result update(@RequestBody UserDTO userDto){
        log.info("更新用户信息:{}",userDto);
        userService.update(userDto);

        return Result.success();
    }
}
